#include <QtGui>
#include "ui_MainWindow.h"

#ifndef MARKER_H
#define MARKER_H

class Marker : public QGraphicsObject
{
    //Q_DECLARE_TR_FUNCTIONS(Marker)
    Q_OBJECT

public:
    enum Shape { Circle,Square,Triangle };

    Marker();

    void setOutlineColor(const QColor &color);
    void setBackgroundColor(const QColor &color);
    void setShape(Shape shape);
    void setSize(short size);

    void getShape(Shape shape);
    qreal getXpos();
    qreal getYpos();

    void paint(QPainter *painter,const QStyleOptionGraphicsItem *option, QWidget *widget);
    void markX(qreal x);
    void markY(qreal y);

    QColor outlineColor() const;
    QColor backgroundColor() const;
    QRectF boundingRect() const;
    QPainterPath shape() const;

protected:
    QVariant itemChange(GraphicsItemChange change,const QVariant &value);

private:
    int mySize;
    int myCount;
    qreal myPosx;
    qreal myPosy;
    int roundness(double size) const;

    QRectF Marker::outlineRect() const;
    QColor myBackgroundColor;
    QColor myOutlineColor;

    Shape  myShape;

signals:
    void markerPosPre(qreal xpos, qreal ypos);

};

#endif // MARKER_H
